import request from '@/utils/request'

// 查询定时任务调度列表
export function listJob(data) {
  return request({
    url: '/schedule/job/list',
    method: 'post',
    data,
  })
}

// 新增定时任务调度
export function addJob(data) {
  return request({
    url: '/schedule/job/add',
    method: 'post',
    data,
  })
}

// 修改定时任务调度
export function updateJob(data) {
  return request({
    url: '/schedule/job/edit',
    method: 'post',
    data,
  })
}

// 删除定时任务调度
export function delJob(data) {
  return request({
    url: '/schedule/job/remove',
    method: 'post',
    data,
  })
}

// 定时任务立即执行一次
export function runJob(jobId, jobGroup) {
  const data = {
    jobId,
    jobGroup,
  }
  return request({
    url: '/schedule/job/run',
    method: 'post',
    data,
  })
}
// 导出定时任务
export function exportJob() {
  return request({
    url: '/schedule/job/export',
    method: 'post',
  })
}
